package com.hoki.zj.hrm.interceptor.utils;

import com.hoki.zj.hrm.vo.AggsVo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

/**
 * ES查询类:ESSearchBucketsList
 * 封装了聚合查询的数据
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ESSearchBucketsList<T> extends com.hoki.zj.hrm.utils.PageList<T> {
    /**
     * // key
     * grandNme": {
     *
     *    // value
         "buckets": [
             {
             "key": "白金",
             "doc_count": 3
             },
             {
             "key": "白银",
             "doc_count": 3
             },
             {
             "key": "青铜",
             "doc_count": 2
             }
         ]
     }
     */
    Map<String, List<AggsVo>> aggsResult = null;

    public ESSearchBucketsList() {}

    public ESSearchBucketsList(long totalElements, List<T> content, Map<String, List<AggsVo>> aggsResult) {
        super(totalElements, content);
        this.aggsResult = aggsResult;
    }
}
